package com.javaear.beangenerator.render;

import com.javaear.beangenerator.Beaner;
import com.javaear.beangenerator.processor.JsonReverseProcessor;

/**
 * render bean file from json string
 *
 * @author aooer
 */
public class JsonRender extends AbstractRender {

    public Beaner raiseBeaner(String beanName) {
        JsonReverseProcessor processor = new JsonReverseProcessor();
        context.put("json_beanName", beanName);
        processor.init(context);
        return processor.process();
    }

    /**
     * set jsonStr to context for parse process
     *
     * @param dataStr json data string
     */
    public JsonRender(String dataStr) {
        context.put("json_param", dataStr);
    }

}
